#!/usr/bin/perl
use strict;
use warnings;
use Test::More tests => 7;

BEGIN { use_ok 'Test::WWW::Mechanize::Catalyst', 'WIAB';
        use_ok 'WIAB::Controller::SiteMap';
        use_ok 'FindBin';
        use_ok 'Path::Class';
        require "$FindBin::Bin/bin/make_test_env.pl";
    }
END { require FindBin;
       require "$FindBin::Bin/bin/remove_test_env.pl"
   }



my $mech = Test::WWW::Mechanize::Catalyst->new;

$mech->get_ok('http://localhost/sitemap/google', 'got sitemap');
$mech->content_contains("google sitemap generated, set config var 'gsm_ping' to equal 1 to enable automatic ping of google on generation", 'says it generated the sitemap');
my $sitemap_file = Path::Class::Dir->new($FindBin::Bin)->subdir('content')->file('sitemap.gz');
ok (-e "$sitemap_file", 'sitemap file is there');


